package design.patterns.iterator;

/**
 * @Desc:
 * @author: cww
 * @DateTime: 2020/6/12 19:46
 */

public class MainTest {
    private Iterator it;
    private Aggregate agg= new ConcreteAggregate();
    public void operation(){
        it = agg.createIterator();
        while (!it.isDone()) {
            System.out.println(it.currentItem().toString());
            it.next();
        }
    }

    public static void main(String[] args) {
        MainTest mainTest = new MainTest();
        mainTest.operation();
    }
}
